{% load i18n %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<script src="/media/jslib/jquery.js"></script>
		<script src="/media/jslib/jquery.validate.js"></script>
		<script src="{{ MEDIA_URL }}/jslib/i18n.js"></script>
		<script src="{{ MEDIA_URL }}/jslib/i18n_{{ LANGUAGE_CODE }}.js"></script>
		<script src="{{ MEDIA_URL }}/jslib/dwz.util.date.js"></script>
		<script src="{{ MEDIA_URL }}/jslib/dwz.datepicker.js"></script>
		<script src="{{ MEDIA_URL }}/jslib/jquery.plus.js"></script>
		<script src="{{ MEDIA_URL }}/jslib/jquery.ztree-2.6.min.js"></script>
		<script src="{{ MEDIA_URL }}/jslib/jquery.zcommon.js"></script>
		{% include "site_medias_css.html" %}	
	</head>
<body style=" background:white;">
{% block addmiddiv %}
	<div id="id_tab" >
            <div class="portlet-header sfActive">
                {% block position %}
                <ul><li class="floatL"><span class='icon_SiteMap'>&nbsp;</span>{% trans "当前位置：" %}
                {% if position %} 
					{{position}}->
				{% else %} 
					<span id="id_rel_log">{{ app_menu|translate_str }}</span>
					-> {{ title|translate_str|escape }}->
				{% endif %}
				{% if add %}
					{% trans "增加" %}
				{% else %}
					{%trans "详情"%}
				{% endif %}</li></ul>
                {% endblock %}
                <ul><li  class="floatR"><a href="{{ request.dbapp_url }}system/help/?p=/file/{{ LANGUAGE_CODE }}/help/{% if help_model_name %}{{ help_model_name|lower }}{% else %}{{ model_name|lower }}{% endif %}.html" target="_blank" title="{% trans '当前页帮助' %}" class="icon_help_current"></a></li></ul>
                <ul class="floatR set_index Link_blue1">
                </ul>
				
            </div>
        </div>
    <div style="margin:0px;padding:0px;">
	{% block content %}
		<form method="post" onkeydown="if(event.keyCode==13){return false;}"  id="id_edit_form" enctype="multipart/form-data"{% if action_url %} action="{{ action_url }}"{% endif %}>
			<input type="hidden" id="id_model_pk" name="pk" value="{{ instance.pk }}" />

			{% block help_panel %}
			<div class="form_help">
			{% if form.admin_help_text %}
			<div id="id_help_text">{% block help_image %}{% if form.admin_help_image %}<img src="{{ form.admin_help_image }}" align ="left" /> {% endif %}{% endblock %} {% autoescape off %}{{ form.admin_help_text }} {% endautoescape %} </div>
			{% endif %}
			<div id="id_help" style="text-align: right;">
				{% block help_difine %}{% endblock %}
				<a href='javascript:void(0);' ref="{{ MEDIA_URL }}/help/{{ LANGUAGE_CODE }}/{{ dataOpt.app_label }}/{{ model_name }}#{% if detail %}{{ detail }}{% else %}detail{% endif %}"  ></a>
			</div>
			<div class="clear"></div>
			</div>
			{% endblock %}<!-- help_panel -->


			<table cellpadding="3" style="margin:0px 10px 0px 10px; position:relative;" class="tbl_data_edit">
			<tr><td clospan="6">
			<div id="id_tabs">
			</div>
			</td></tr>

			<tr id="pre_addition_fields">{% block pre_addfields %}{% endblock %}</tr>
			
			{% block form %}
			{{ form.as_table }}
			{% endblock %}<!-- form -->

			<tr id="addition_fields">
			{% block addfields %}
			{% autoescape off %} 
		        <th height="20">
		        	<label for="id_parent">{% trans "转交审批人" %}:</label>
		        </th>
		        <td>
		        <input id="id_show_input" class="wZBaseCharField input_showDeptTree" type="text"  readonly="readonly"></input>
				<span class="btn_showDeptTree">
				    <img id="id_drop_dept" onclick="javascript:$(this).parent().find('#show_deptment').show().bgiframe();" src="/media/img/sug_down_on.gif"></img>
				    <div id="show_deptment" style="display: none;">
				        <div class="title" onclick="javascript:$(this).parent().parent().find('#show_deptment').hide();">
				            <span class="close btn" >
				                {% trans "确定" %}
				            </span>
				        </div>
				        <div id="id_dept" class="dispayN">
				            <ul id="position_tree_by_dept" class="tree"></ul>
				        </div>
				    </div>
				
				</span>
				<div>
				
				</div></td>
		        <td><td/>
		        
		{% endautoescape %}
			
			{% endblock %}</tr>
			</table>

			{% if request.is_ajax %}{% else %}
			
			{% endif %}


		</form>
		<input type="hidden" id="app_label" value="/{{app_label}}"/>
		<input type="hidden" id="model_name" value="/{{model_name}}"/>
		<input type="hidden" id="data_model_url" value="/{{app_menu}}/{{model_name}}"/>

		<div id="id_info"></div>
		{% block edit_buttons %}
		<div class="editformbtn">
			<div class="lineH22 img_padding">
				<span class="action_OK"></span>
				<a class="Link_blue1" href="javascript:void(0)" id="OK">{% trans "确定" %}</a>
			</div>
			<div class="lineH22 img_padding">
				<span class="action_Cancel"></span>
				<a class="Link_blue1" href="javascript:void(0)" id="Cancel">{% trans "取消" %}</a>
			</div>
		</div>
		{% endblock %}
		<script>
			{% block addjs %}
			before_submit = function(){
				if($("#position_tree_by_dept").find('ul>li').length > 0 && $("#id_show_input").val().length == 0){
					$('#id_info').html("<ul class='errorlist'><li>"+gettext('请选择转交审批人!')+"</li></ul>")
					return false
				}else{
			          return true
			    }
			}
			{% endblock %}
		</script>
		{% block add_contents %}{% endblock %}
	{% endblock %}<!-- content ???-->
	</div>

{% endblock %}
</body>
</html>
<script src="{{ MEDIA_URL }}/flexigrid/flex_base_edit.js"></script>
<script src="{{ MEDIA_URL }}/flexigrid/flex_base_audit.js"></script>
